CREATE PROCEDURE [dbo].[UserGet]
@Id			UNIQUEIDENTIFIER, 
@UserName	NVARCHAR(20)

AS

SELECT	*
FROM	[User]
WHERE
		 (@Id			IS NULL OR Id = @Id)
	AND  (@UserName		IS NULL OR UserName = @UserName)

RETURN @@ROWCOUNT
  